<?php

require_once dirname(__FILE__) . '/../lib/cambiarDatosGeneratorConfiguration.class.php';
require_once dirname(__FILE__) . '/../lib/cambiarDatosGeneratorHelper.class.php';

/**
 * cambiarDatos actions.
 *
 * @package    BecArTe
 * @subpackage cambiarDatos
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class cambiarDatosActions extends autoCambiarDatosActions {

    public function executeEdit(sfWebRequest $request) {
        if ($request->getParameter('id') == $this->getUser()->getAlumno()->getId()) {
            $this->alumno = $this->getRoute()->getObject();
            $this->form = $this->configuration->getForm($this->alumno);
        } else {
            $this->getUser()->setFlash("error", "Operacion no permitida");
            $this->redirect("mis_becas");
        }
    }

// Esto es para que no puedar crear otros usuarios o listarlos
    public function executeNew(sfWebRequest $request) {
        $this->getUser()->setFlash("error", "Operacion no permitida");
        $this->redirect("mis_becas");
    }

    public function executeIndex(sfWebRequest $request) {
        $this->getUser()->setFlash("error", "Operacion no permitida");
        $this->redirect("mis_becas");
    }

}
